package cn.xiaopengstack.domain.pay.service;

import cn.xiaopengstack.domain.pay.model.entity.CreatePayEntity;
import cn.xiaopengstack.domain.pay.model.entity.CreatePayReqEntity;
import cn.xiaopengstack.domain.pay.model.entity.PayResultEntity;
import cn.xiaopengstack.types.enums.PayChannelEnum;
import com.alipay.api.AlipayApiException;

/**
 * @author jiangyangang
 */
public interface IPayService {

    /**
     * 创建支付单
     * @param reqEntity
     * @return
     */
    CreatePayEntity createPay(CreatePayReqEntity reqEntity) throws AlipayApiException;

    /**
     * 处理支付结果
     * @param payResult
     * @throws Exception
     */
    void executePayResultHandel(Object payResult) throws Exception;

    /**
     * 查询支付单结果
     * @param payOrderId
     * @return
     * @throws Exception
     */
    PayResultEntity queryPayResult(String payOrderId) throws Exception;

    /**
     * 支付渠道
     * @return
     */
    PayChannelEnum channel();
}
